package com.snowy.framework.common.base.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * 每页查询返回对象
 *
 * @author Melody
 *
 * @param <T>
 */
@ApiModel(value = "通用分页结果集")
public class SlicedQueryResult<T> implements Serializable {

	private static final long serialVersionUID = -1732171018957130308L;

	/**
	 * 页码
	 */
	@ApiModelProperty(value = "页码",example = "1")
	private Integer pageIndex;
	/**
	 * 每页数量
	 */
	@ApiModelProperty(value = "页大小",example = "10")
	private Integer pageSize;
	/**
	 * 数据量
	 */
	@ApiModelProperty(value = "总数量",example = "10")
	private Long recordCount;
	/**
	 * 数据集合
	 */
	@ApiModelProperty(value = "结果集")
	private List<T> rows;

	public SlicedQueryResult(Integer pageIndex, Integer pageSize, Long recordCount, List<T> rows) {
		this.pageIndex = pageIndex;
		this.pageSize = pageSize;
		this.recordCount = recordCount;
		this.rows = rows;
	}

	public SlicedQueryResult(Integer pageIndex, Integer pageSize) {
		this.pageIndex = pageIndex;
		this.pageSize = pageSize;
	}

	public Integer getPageIndex() {
		return this.pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getPageSize() {
		return this.pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getRecordCount() {
		return recordCount;
	}

	public void setRecordCount(Long recordCount) {
		this.recordCount = recordCount;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

}
